package cn.kgc.crowdfundingadminspringboot.controller;

import cn.kgc.crowdfundingadminspringboot.pojo.Admin;
import cn.kgc.crowdfundingadminspringboot.service.AdminService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class AdminController {
    @Resource
    AdminService adminService;

    @GetMapping("/admin/getbyid/{id}")
    @ResponseBody
    public Admin getByID(@PathVariable Integer id){
        return adminService.getByid(id);
    }


    @RequestMapping("/admin/to/login/page.html")
    public String toLoginPage() {
        return "admin-login";
    }
}
